﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace Test.Expressions
{

	//these classes do not directly have columns or their own select statement. They are intended to be 
	//wrapped in a SelectExpression.
	
	public class JoinExpression : DbExpression
	{
		
		public JoinExpression(
			SubqueryExpression second,
			Type returnType,						
			Expression condition)
			: base(nodeType: DbExpressionType.Join, type: returnType) {			
			this.condition = condition;
			this.second = second;			
		}

		Expression condition;
		Expression second;		
		public new Expression Condition {
			get { return this.condition; }
		}
		//Expression result;
		//public Expression Result { get { return result; } }
		public Expression Second {
			get { return this.second; }
		}
	}
	public class CrossApplyExpression : DbExpression
	{
		Expression second;		
		
		/// <see cref="http://msdn.microsoft.com/en-us/library/bb534336.aspx"/>				
		public CrossApplyExpression(SubqueryExpression second, 
			Type returnType,
			DbExpressionType nodeType = DbExpressionType.CrossApply)
			: base(nodeType: nodeType, type: returnType) {

			this.second = second;
		}
	
		public Expression Second {
			get { return this.second; }
		}
		
	}
}
